<?xml version="1.0" encoding="utf-8"?>
<!-- DWXMLSource="../CotizacionesXML/00330/00330.xml" -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc='http://wlm.com.mx/SAI/doc'>
  <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  <xsl:param name="tipoImpresion"></xsl:param>
  <xsl:decimal-format name="dollar"
decimal-separator="." grouping-separator=","/>
  <xsl:template match="//doc:Documento">
  <html>
  <body>
    <center style="text-transform:uppercase;">
      <table cellspacing="0" cellpadding="1" width="700" bgcolor="#222222" border="0">
        <tbody>
          <tr>
            <td><table cellspacing="0" cellpadding="0" width="700" border="0" style="font-size:10px;font-family: Arial, Helvetica, sans-serif;">
                <tbody>
                  <tr>
                    <td valign="middle" width="100%" bgcolor="#ffffff" height="40"><h2 align="center">Manufacture Professional Hardware</h2></td>
                  </tr>
                  <tr>
                    <td bgcolor="#000000" height="8"><p align="right"></p></td>
                  </tr>
                </tbody>
              </table>
              <table cellspacing="0" cellpadding="10" bgcolor="#ffffff" border="0" style="font-size:10px;font-family: Arial, Helvetica, sans-serif;">
                <tbody>
                  <tr>
                    <td valign="top" width="700" bgcolor="#ffffff"><b>No Cotizacion#: </b><xsl:value-of select="@NoDocumento"/> <br/>
                      <br/>                      
                      <strong>Cliente: </strong><xsl:value-of select="@NoCliente"/> - <xsl:value-of select="@NombreCliente"/><br />
                      <br />
                      <b>Fecha de Creacion:</b><xsl:call-template name="FormatDate">
                        <xsl:with-param name="DateTime" select="@FechaCreacion"/>
                      </xsl:call-template><br />
                      
                      <br />
                      <table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:10px;font-family: Arial, Helvetica, sans-serif;">
                        <tr valign="top">
                          <td width="49%"><strong>Datos de Facturacion</strong></td>
                          <td style="padding-left:10px;"><strong>Datos de Envio</strong></td>
                        </tr>
                        <tr valign="top">
                          <td colspan="2"><hr size="1" noshade="noshade" color="#cccccc" /></td>
                        </tr>
                        <tr valign="top">
                          <td>
                          <xsl:apply-templates select="//doc:DireccionFacturacion"/>
                           </td>
                          <td style="border-left: solid 1px #cccccc; padding-left:10px;">
                          
                          <xsl:apply-templates select="//doc:DireccionEnvio"/>
                           </td>
                        </tr>
                        <tr valign="top">
                          <td colspan="2"><hr size="1" noshade="noshade" color="#cccccc" /></td>
                        </tr>
                      </table>
                      <br/>
                      <table cellspacing="0" cellpadding="2" width="100%" border="0" style="font-size:10px;font-family: Arial, Helvetica, sans-serif;">
                        <tbody>
                          <tr>
                            <td bgcolor="#dddddd"><b>Cant</b></td>
                            <td nowrap="nowrap" bgcolor="#dddddd"><strong>Categoria</strong></td>
                            <td bgcolor="#dddddd"><strong>Linea</strong></td>
                            <td bgcolor="#dddddd"><b>Descripcion</b></td>
                            <td align="right" bgcolor="#dddddd"><b>Precio</b></td>
                            <td align="right" bgcolor="#dddddd"><b>Importe</b></td>
                          </tr>


<xsl:apply-templates  select="//doc:Concepto">
              <xsl:with-param name="tipoImp" select="$tipoImpresion"/>
            </xsl:apply-templates>
            <xsl:for-each select="Concepto">
            </xsl:for-each>

                          <tr height="3">
                            <td colspan="6" height="3" style="height:3px;">
                              <hr size="1" noshade="noshade" color="#cccccc" />
                            </td>
                          </tr>
                          <tr>
                            <td align="center"></td>
                            <td colspan="3" rowspan="4">
                              Observaciones: <xsl:value-of select="//doc:Observaciones"/>

                            </td>
                            <td align="right">SubTotal</td>
                            <td align="right">
                              $ <xsl:value-of select="format-number(@SubTotal, '#,##0.00','dollar')"/>
                            </td>
                          </tr>
                          <tr>
                            <td align="center"></td>
                            <td align="right">
                              Descuento
                            </td>
                            <td align="right">
                              <xsl:value-of select="format-number(@Descuento, '#,##0.00','dollar')"/>%
                            </td>
                          </tr>
                          <tr>
                            <td align="center"></td>
                            <td align="right">I.V.A.</td>
                            <td align="right">
                              $ <xsl:value-of select="format-number(@IVA, '#,##0.00','dollar')"/>
                            </td>
                          </tr>
                          <tr>
                            <td align="center"></td>
                            <td align="right">Total</td>
                            <td align="right">
                              $ <xsl:value-of select="format-number(@Total, '#,##0.00','dollar')"/>
                            </td>
                          </tr>
                          <tr>
                            <td colspan="6">
                              <hr size="1" noshade="noshade" color="#cccccc" />
                            </td>
                          </tr>
                        </tbody>
                      </table>
                    
                    </td>
                  </tr>
                  </tbody>
              </table></td>
          </tr>
        </tbody>
      </table>
    </center>
    </body>
    </html>
  </xsl:template>
  
  <xsl:template match="//doc:DireccionEnvio">
    <div id="address">
    <table id="meta-1" style="font-size:10px;font-family: Arial, Helvetica, sans-serif;">
            <tbody>
              <tr>
                <td class="meta-head">Calle</td>
                <td><xsl:value-of select="@Calle"/><xsl:value-of select="@NumeroExterior"/>-<xsl:value-of select="@NumeroInterior"/></td>
              </tr>
              <tr>
                <td class="meta-head">Colonia</td>
                <td><xsl:value-of select="@Colonia"/></td>
              </tr>
              <tr>
                <td class="meta-head">Ciudad</td>
                <td><xsl:value-of select="@Ciudad"/></td>
              </tr>
              <tr>
                <td class="meta-head">Municipio</td>
                <td><xsl:value-of select="@Municipio"/></td>
              </tr>
              <tr>
                <td class="meta-head">Estado</td>
                <td><xsl:value-of select="@Estado"/></td>
              </tr>
              <tr>
                <td class="meta-head">C.P.</td>
                <td><xsl:value-of select="@CP"/></td>
              </tr>
              </tbody>
              </table>
              </div>
  </xsl:template>
  
  <xsl:template match="//doc:DireccionFacturacion">
    <div id="address">
    <table id="meta-1" style="font-size:10px;font-family: Arial, Helvetica, sans-serif;">
            <tbody>
              <tr>
                <td class="meta-head">Calle</td>
                <td><xsl:value-of select="@Calle"/><xsl:value-of select="@NumeroExterior"/>-<xsl:value-of select="@NumeroInterior"/></td>
              </tr>
              <tr>
                <td class="meta-head">Colonia</td>
                <td><xsl:value-of select="@Colonia"/></td>
              </tr>
              <tr>
                <td class="meta-head">Ciudad</td>
                <td><xsl:value-of select="@Ciudad"/></td>
              </tr>
              <tr>
                <td class="meta-head">Municipio</td>
                <td><xsl:value-of select="@Municipio"/></td>
              </tr>
              <tr>
                <td class="meta-head">Estado</td>
                <td><xsl:value-of select="@Estado"/></td>
              </tr>
              <tr>
                <td class="meta-head">C.P.</td>
                <td><xsl:value-of select="@CP"/></td>
              </tr>
              </tbody>
              </table>
              </div>
  </xsl:template>
  
   <xsl:template match="//doc:Concepto">
    <xsl:param name="tipoImp"></xsl:param>
  
  <tr bgcolor="#f9f9f9">
                            <td align="center" ><xsl:value-of select="@cantidad"/></td>
                            <td><xsl:value-of select="@categoria"/></td>
                            <td><xsl:value-of select="@linea"/></td>
                            <td><xsl:value-of select="@descripcion"/> </td>
                            <td align="right">$ <xsl:value-of select="format-number(@valorUnitario, '#,##0.00','dollar')"/></td>
                            <td align="right">$ <xsl:value-of select="format-number(@importe, '#,##0.00','dollar')"/></td>
                          </tr>
  </xsl:template>
  
  
  <xsl:template name="FormatDate">
    <xsl:param name="DateTime" />
    <xsl:variable name="year" select="substring($DateTime,1,4)" />
    <xsl:variable name="month-temp" select="substring-after($DateTime,'-')" />
    <xsl:variable name="month" select="substring-before($month-temp,'-')" />
    <xsl:variable name="day-temp" select="substring-after($month-temp,'-')" />
    <xsl:variable name="day" select="substring($day-temp,1,2)" />
    <xsl:variable name="time" select="substring-after($DateTime,'T')" />
    <xsl:variable name="hh" select="substring($time,1,2)" />
    <xsl:variable name="mm" select="substring($time,4,2)" />
    <xsl:variable name="ss" select="substring($time,7,2)" />
    
    <!-- Long DATE FORMAT -->
    
    <xsl:value-of select="$day"/><xsl:value-of select="' de '"/><!--January -->
    <!--January 12 -->
    <xsl:choose>
      <xsl:when test="$month = '1' or $month= '01'">
        Enero
      </xsl:when>
      <xsl:when test="$month = '2' or $month= '02'">
        Febrero
      </xsl:when>
      <xsl:when test="$month= '3' or $month= '03'">
        Marzo
      </xsl:when>
      <xsl:when test="$month= '4' or $month= '04'">
        Abril
      </xsl:when>
      <xsl:when test="$month= '5' or $month= '05'">
        Mayo
      </xsl:when>
      <xsl:when test="$month= '6' or $month= '06'">
        Junio
      </xsl:when>
      <xsl:when test="$month= '7' or $month= '07'">
        Julio
      </xsl:when>
      <xsl:when test="$month= '8' or $month= '08'">
        Augosto
      </xsl:when>
      <xsl:when test="$month= '9' or $month= '09'">
        Septiembre
      </xsl:when>
      <xsl:when test="$month= '10'">
        Octubre
      </xsl:when>
      <xsl:when test="$month= '11'">
        Noviembre
      </xsl:when>
      <xsl:when test="$month= '12'">
        Diciembre
      </xsl:when>
    </xsl:choose>
    <xsl:value-of select="' de'"/><!--January 12,-->
    <xsl:value-of select="' '"/><!--January 12, -->
    <xsl:value-of select="$year"/><!--January 12, 2001-->
    <!--
    <xsl:value-of select="' a las '"/><xsl:value-of select="$hh"/><xsl:value-of select="':'"/><xsl:value-of select="$mm"/><xsl:value-of select="':'"/><xsl:value-of select="$ss"/><xsl:value-of select="' (GMT) '"/>-->
    <!-- END: Long DATE FORMAT -->
    
  </xsl:template>
</xsl:stylesheet>